<?php
class Application_Model_Blog extends Zend_Db_Table_Abstract
{
	protected $_name = "blog_entries";
	protected $_primary = "BLEN_ID";
	
	protected $_referenceMap = array(
		'Status' => array(
			'columns' => 'BLST_ID',
			'refTableClass' => 'Application_Model_BlogStatus', 
			'refColumns' => 'BLST_ID'
		), 
		'CreateUser' => array(
			'columns' => 'BLEN_CREATE_USER', 
			'refTableClass' => 'Application_Model_User', 
			'refColumns' => 'USER_ID'
		)
	);
	
	
	
}

/*
class Application_Model_BlogStatus extends Zend_Db_Table_Abstract
{
	protected $_name = "blog_status";
	protected $_primary = "BLST_ID";
	protected $_dependentTables = array('Application_Model_Blog');
}
*/

/*
class Application_Model_Blog 
{
	protected $_id; 
	protected $_create_date;
	protected $_create_user;
	protected $_title; 
	protected $_description; 
	
	public function __construct(array $options = null)
	{
		if (is_array($options))
		{
			$this->setOptions($options);
		}
	}
	
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method))
		{
			throw new Exception('Invalid blog property');
		}	
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method))
		{
			throw new Exception('Invalid blog property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value)
		{
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods))
			{
				$this->$method($value);
			}
		}
		return $this;
	}
	
	public function setId($id)
	{
		$this->_id = (int) $id;
		return $this;
	}
	public function getId()
	{
		return $this->_id;
	}
	
	public function setCreateDate($date)
	{
		$this->_create_date = $date;
		return $this;	
	}
	
	public function getCreateDate()
	{
		return $this->_create_date;
	}
	
	public function setCreateUser($user)
	{
		$this->_create_user = $user;
		return $this;	
	}
	
	public function getCreateUser()
	{
		return $this->_create_user;	
	}
	
	public function setTitle($title)
	{
		$this->_title = $title;
		return $this;
	}
	
	public function getTitle()
	{
		return $this->_title;
	}
	
	public function setDescription($desc) 
	{
		$this->_description = $desc;
		return $this;
	}
	public function getDescription() 
	{
		return $this->_description;
	}
	
	
}


class Application_Model_BlogMapper
{
    public function save(Application_Model_Blog $blog);
    public function find($id);
    public function fetchAll();
}
*/
